<template>
  <div class="popup-container">
    <div class="title">🎨 封面图制作工具</div>
    <div class="route-path">当前路由：{{ currentPath }}</div>
    <button @click="openEditor" class="button">打开制作工具</button>
    


    <router-link to="/">首页</router-link>
    <router-link to="/chat">聊天</router-link>
    <router-view />
</div>



</template>

<script>

import Chat from './Chat.vue'

export default {
  name: 'PopupApp',
  components: {
    Chat
  },
  data() {
    return {
      showChat: false
    }
  },
  methods: {
    openEditor() {
      // 发送消息给 background script 打开新标签页
      chrome.runtime.sendMessage({action: 'openEditor'})
      
      // 关闭 popup
      window.close()
    },
    openChat() {
      this.showChat = true
    }
  },
  computed: {
    currentPath() {
      return this.$route.path
    }
  }
}
</script> 